package com.piccolo.wrapper.client.component;

import com.piccolo.wrapper.client.component.Overlay.PLayerOverlay;

/**
 * @author Maria Patrickson
 * @version 1.0
 */
public class PLayer extends PNode 
{
	/**
	 * Creates a new PLayer with the specified JavaScript object overlay.
	 * @param overlay
	 */
	public PLayer(PLayerOverlay overlay)
	{
		this.overlay = overlay;
	}

	/**
	 * Creates a new PLayer.
	 */
	public PLayer() 
	{
		this.overlay = PLayerOverlay.create();
	}

	/**
	 * Creates a new PLayer with the specified style and boundaries.
	 * @param fillStyle
	 * @param bounds
	 */
	public PLayer(String fillStyle, PBounds bounds)
	{
		this.overlay = PLayerOverlay.create(fillStyle, bounds);
	}

	/**
	 * Adds a camera to this PLayer
	 * @param camera
	 */
	public void addCamera(PCamera camera) 
	{
		((PLayerOverlay) overlay).addCamera(camera);
	}

	/**
	 * Removes the specified camera from this PLayer
	 * @param camera
	 */
	public void removeCamera(PCamera camera) 
	{
		((PLayerOverlay) overlay).removeCamera(camera);
	}
}